package com.lg.okframe.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.lg.okframe.R;
import com.lg.okframe.base.BaseActivity;

public class BookReadActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout sss = initTitlebar(R.mipmap.back, 0, "笔记", false);


        ListView lv_ = (ListView) sss.findViewById(R.id.lv_);


        lv_.setAdapter(new BaseAdapter() {
            @Override
            public int getCount() {
                return 27;
            }

            @Override
            public Object getItem(int i) {
                return null;
            }

            @Override
            public long getItemId(int i) {
                return 0;
            }

            @Override
            public View getView(int i, View view, ViewGroup viewGroup) {

                TextView textView = new TextView(BookReadActivity.this);
                textView.setPadding(30,40,30,40);
                textView.setText("Day" + (i + 1) + "笔记");

                return textView;
            }
        });

        lv_.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

                Intent intent = new Intent(BookReadActivity.this, WebViewActivity.class);
                intent.putExtra("index", i + 1);
                startActivity(intent);

            }
        });

    }

    @Override
    protected int setMainView() {
        return R.layout.activity_book_read;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected boolean leftIconClickListener(View view) {
        finish();

        return false;
    }

    @Override
    protected boolean rightIconClickListener(View view) {
        return false;
    }

    @Override
    public void onClick(View view) {

    }

    @Override
    public void onSwipeBackLayoutSlide(float slideOffset) {

    }

    @Override
    public void onSwipeBackLayoutCancel() {

    }
}
